home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
questTroubleTheEndb.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
2KB
|
67 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTroubleTheEndb entered");
setState("initial");
end )
-- debug mechanism, should be implemented properly such that a reset by questormessage is possible
-- make sure that the initial condition wont be triggerd right away, maybe reset all prerequesites in order to prevent that
onMsg("questreset", function(msg)
getParent().getParent().getCharacter(MIKE).decRelationshipCondition(ELAINE, REL_TROUBLE,1);
getParent().getParent().getCharacter(ELAINE).decRelationshipCondition(MIKE, REL_TROUBLE,1);
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 10 )
then
-- go to talk position
--elaine.cancelAllActivities();
--mike.cancelAllActivities();
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTroubleTheEndb");
setState("talktome");
end
end )
state("talktome")
-- assoon as arrived - start dialog
----------------
onMsg("talking", function(msg)
if (msg.data == "questTroubleTheEndb") then
popupConversation("dialogTroubleTheEndb");
setState("donetalktome");
end
----------------
end )
state("donetalktome");
onMsg("yes", function(msg)
getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()